	$(function($){
		//
	});
	$('#gallery a').lightBox({
		overlayOpacity: 0.6,
		imageLoading: ROOT_PATH + '/html/images/box/loading.gif',
		imageBtnClose: ROOT_PATH + '/html/images/box/close.gif',
		imageBtnPrev: ROOT_PATH + '/html/images/box/prev.gif',
		imageBtnNext: ROOT_PATH + '/html/images/box/next.gif',
		txtImage: 'Product images'
		}
	);
	
	function setinfobox(o,txtbox){
		for(i=1;i<6;i++)
		{
		document.getElementById('bu'+i).className = "" ;
		}

		document.getElementById('bu'+o).className = "hots" ;

		document.getElementById("infotext").innerHTML=document.getElementById(txtbox).innerHTML;
	}
	setinfobox('1','pay');

	$('#addNameNum1').click(
			function (){
				$('#nameNumDiv').show();
				$('#printnumber_big_div').show();
			}
		);

		$('#addNameNum2').click(
			function (){
				$('#nameNumDiv').hide();
				$('#printnumber_big_div').hide();
			}
		);
	function PrintNNSave()
	{
		$("input[type='image']").trigger("click");
		//$('#printnumber_big_div').hide();
		//$('#addNameNum1').focus();
	}

	$('#prooriginalnumber1').click(
		function (){
			$('#pintorininnameNumDiv').show();
	         $('#pintnameNumDiv').hide();
		}
	);

	$('#prooriginalnumber2').click(
		function (){
			$('#pintnameNumDiv').show();
			$('#pintorininnameNumDiv').hide();
		}
	);

	 $('#proocustomizeriginal1').click(
		function (){
			$('#originalpintnameNumDiv').show();
		}
	);
		
	 $('#proocustomizeriginal2').click(
		function (){
			$('#originalpintnameNumDiv').hide();
		}
	);
	
	function checkForm(){
		var minArray=$('input[name="min_counts[]"]');
		var maxArray=$('input[name="max_counts[]"]');
		var counts=0;
		var isTrue=true;
		$('input[name="counts[]"]').each(
			function(){
				if(!numTest($(this).val())){
					isTrue=false;
				}else{
					counts+=parseInt($(this).val());
				}
			}
		);
		if(!isTrue){
			alert("Please enter the correct quantity you want to buy!");
			return false;
		}
		if(counts<parseInt($(minArray[0]).val())){
			alert("The quantity you entered is too few!");
			return false;
		}
		if(counts>parseInt($(maxArray[maxArray.size()-1]).val())){
			alert("The quantity you entered is too many!");
			return false;
		}
		var checkedNameNum=false;
		$('input[name="addNameNum"]').each(
			function(){
				if($(this)[0].checked==true){
					checkedNameNum=true;
				}
			}
		);
		if(!checkedNameNum){
			alert("Please choose whether you want to print the name or number on the shirt!");
			return false;
		}
		
		//选择了打印原始号不+个性号
		var is_post = true;
		$(".psize").each(function(){
			var size = $(this).attr("pv");
			var temp_obj_amount = 0;
			$("select[name='printshirtSize[]']").each(function(){
				if($(this).val() == size) {
					temp_obj_amount = parseInt($(this).next("input").val()) + temp_obj_amount;
				}
			});
			if(temp_obj_amount > $(this).val()) {
				alert("The amount you total input is more then the size's total count Size:" + size);
				is_post = false;
				return false;
			}
		});
		if(is_post == false)
			return is_post;
		/*
		
		if($('#addNameNum1').attr('checked')){
			//选择了打印
			if($('#prooriginalnumber1').attr('checked')){
				//选择了打印原始号
				var is_post = true;
				$(".psize").each(function(){
					var size = $(this).attr("pv");
					var temp_obj = $(".Original"+size);
					var temp_obj_amount = 0;
					$(temp_obj).each(function(){
						temp_obj_amount = parseInt($(this).val()) + parseInt(temp_obj_amount);
					});
					if(temp_obj_amount > $(this).val()) {
						alert("The amount you total input is more then the size's total count Size:" + size);
						is_post = false;
						return false;
					}
				});
				if(is_post == false)
					return is_post;
			}
			
			if($('#prooriginalnumber1').attr('checked') && $('#proocustomizeriginal1').attr('checked')){
				//选择了打印原始号+个性号
				var is_post = true;
				$(".psize").each(function(){
					var size = $(this).attr("pv");
					var temp_obj = $(".Original"+size);
					var temp_obj_amount = 0;
					$(temp_obj).each(function(){
						temp_obj_amount = parseInt($(this).val()) + parseInt(temp_obj_amount);
					});
					$("select[name='originalshirtSize[]']").each(function(){
						if($(this).val() == size) {
							temp_obj_amount = parseInt($(this).next("input").val()) + parseInt(temp_obj_amount);
						}
					});
					if(temp_obj_amount > $(this).val()) {
						alert("The amount you total input is more then the size's total count Size:" + size);
						is_post = false;
						return false;
					}
				});
				if(is_post == false)
					return is_post;
			}
			if($('#prooriginalnumber2').attr('checked')){
				//选择了打印原始号不+个性号
				var is_post = true;
				$(".psize").each(function(){
					var size = $(this).attr("pv");
					var temp_obj_amount = 0;
					$("select[name='printshirtSize[]']").each(function(){
						if($(this).val() == size) {
							temp_obj_amount = parseInt($(this).next("input").val()) + temp_obj_amount;
						}
					});
					if(temp_obj_amount > $(this).val()) {
						alert("The amount you total input is more then the size's total count Size:" + size);
						is_post = false;
						return false;
					}
				});
				if(is_post == false)
					return is_post;
			}
		}
		*/
		return true;
	}
	
	var printorginal_index = 1;
	function addprintparams(obj)
	{
		var _table_obj = $(obj).parents("table");
		var _table_obj_clone = $(_table_obj).clone();
		$(_table_obj_clone).find("input[name='printorginal_0']").each(function(){
			$(this).attr("name","printorginal_"+printorginal_index);
		});
		$(_table_obj_clone).find("input[type='text']").each(function(){
			$(this).attr("value","");
		});
		$(_table_obj_clone).find("image").attr("src","/html/images/Developer_Icons_027.png")
		$(_table_obj_clone).find("image").attr("onclick","").bind("click",function(){
			$(this).parents("table").remove();
		});
		//$(_table_obj).after(_table_obj_clone);
		$("#pintorininnameNumDiv").append(_table_obj_clone);
		printorginal_index = printorginal_index + 1;
	}